<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

/**
 * HTML View class for the View
 */
class TaxiBookingViewSummary extends JView
{

    /**
     * Creates the Forms for the View
     *
     * @since 1.0
     */
    function display($tpl = null)
    {
//		global $mainframe;
        $app = JFactory::getApplication();
        //initialize variables
        $document = & JFactory::getDocument();
        $menus = $app->getMenu();
        $lang = & JFactory::getLanguage();
        $menu = $menus->getActive();
        $uri = & JFactory::getURI();
        $session = & JFactory::getSession();
        $elsettings = & booking_helper::config();

        if ($session->get('dist_miles', 0) == 0)
        {
            $app->redirect(JRoute::_('index.php?option=com_taxibooking', false), 'Session Expired. Please book again.');
        }
        // Get the page/component configuration
        $params = $app->getParams('com_taxibooking');

        //add css file
        $this->document->addStyleSheet($this->baseurl . '/components/com_taxibooking/assets/css/booking.css');

        // right from the menu item itself
        if (is_object($menu))
        {

            $menu_params = new JRegistry;
            $menu_params->loadString($menu->params);

            if (!$menu_params->get('page_title'))
            {

                $params->set('page_title', JText::_('Taxi Booking'));
            }
        }
        else
        {
            $params->set('page_title', JText::_('Taxi Booking'));
        }

        /*
         * Handle the metadata for the categories list
         */
        $this->document->setTitle($title);
        $this->document->setMetadata('keywords', $params->get('page_title'));

        if ($app->getCfg('MetaTitle') == '1')
        {
            $this->document->setMetadata('title', $params->get('page_title'));
        }

        $this->assign('action', $uri->toString());

        $this->assignRef('elsettings', $elsettings);

        parent::display($tpl);
    }

}

?>